package io;

import io.Person;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class OosDemo {
    public static void main(String[] args) throws Exception{
        String name = "吴羽";
        int age = 22;
        String gender = "男";
        String[] otherInfo = {"打游戏", "看电影"};
        Person p = new Person(name, age, gender, otherInfo);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(p);
        System.out.println("写出成功");
        oos.close();
    }
}
